package com.example.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
@Slf4j
public class MyAspect {
    // 定义切点
    @Pointcut("execution(public * com.example.myservlet..*(..))")
    public void serviceMethods() {}

    // 定义通知
    @Before("serviceMethods()")
    public void beforeAdvice() {
        log.info("----------Before method execution-----------MyAspect");
    }


}